/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bff.mpd.musicjukebox.ui.components;

import com.bff.mpd.musicjukebox.lib.actions.StopAction;
import javax.swing.ImageIcon;

/**
 *
 * @author bfindeisen
 */
public class StopButton extends PlayerButton {

    private ImageIcon icon_hover;
    private ImageIcon icon_pressed;
    private ImageIcon icon_stop;

    public StopButton() {
        super();

        icon_hover = new ImageIcon(getClass().getResource("/resources/mpd/player_stop_hover.png"));
        icon_pressed = new ImageIcon(getClass().getResource("/resources/mpd/player_stop_press.png"));
        icon_stop = new ImageIcon(getClass().getResource("/resources/mpd/player_stop.png"));

        setText(null);
        setContentAreaFilled(false);
        setBackground(java.awt.Color.lightGray);
        setBorder(null);
        setFocusPainted(false);
        setMaximumSize(new java.awt.Dimension(40, 40));
        setMinimumSize(new java.awt.Dimension(40, 40));
        setPreferredSize(new java.awt.Dimension(40, 40));
    }

    @Override
    protected void setMousePressedIcon() {
        setIcon(icon_pressed);
    }

    @Override
    protected void setMouseEnteredIcon() {
        setIcon(icon_hover);
    }

    @Override
    protected void setMouseExitedIcon() {
        setIcon(icon_stop);
    }

    @Override
    protected void setAction() {
        setAction(new StopAction(getPlayer()));
    }

    @Override
    protected void setMouseReleasedIcon() {
        setIcon(icon_hover);
    }
}
